←Select platform

RunParallelPipesForList(List<RasterImage>,AutoFormsParallelRunResultRasterImageCallback,List<object>,List<string>,int) Method

Summary

Runs the AutoFormsEngine on a list of RasterImage instances in parallel.

Syntax

C#
C++/CLI
Python
public void RunParallelPipesForList( 
   List<RasterImage> forms, 
   AutoFormsParallelRunResultRasterImageCallback callback, 
   List<object> itemsUserData, 
   List<string> repositoryNames, 
   int pipesCount 
) 
public:  
   void RunParallelPipesForList( 
      List<RasterImage^>^ forms, 
      AutoFormsParallelRunResultRasterImageCallback^ callback, 
      List<Object^>^ itemsUserData, 
      List<String^>^ repositoryNames, 
      Int32 pipesCount 
   ) 
def RunParallelPipesForList(self,forms,callback,itemsUserData,repositoryNames,pipesCount): 

Parameters

forms

List of RasterImage instances.

callback

Callback for each input image after processing.

itemsUserData

Optional list of custom data objects associated to each image.

repositoryNames

Optional List. If the corresponding repository name of item is not null, then RunParallelPipesForList uses it in place of the current value of FullTextSearchRepositoryName.

pipesCount

Number of parallel threads used to consume the input data.

Example

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Auto; 
using Leadtools.Document; 
using Leadtools.Ocr; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Processing; 
using Leadtools.Barcode; 
 
using Leadtools.Forms; 
 
 
void ResultCallbackImage(RasterImage image, AutoFormsRunResult result, int itemIndex, object label) 
{ 
   if (result == null) 
   { 
      Console.WriteLine($"ERROR!!!: Failed to process {label}: [{itemIndex}]"); 
   } 
   else 
   { 
      Console.WriteLine($"Successfully processed {label}: [{itemIndex}]"); 
      foreach (FormPage page in result.FormFields) 
      { 
         foreach (FormField field in page) 
         { 
            Console.WriteLine($"Process for the field {field.Name} is {field.Result.Status} "); 
         } 
      } 
   } 
} 
 
void ProcessFormsMultiProcessListImages(AutoFormsEngine autoEngine, List<string> fileNames, List<string> repositoryNames) 
{ 
   var codecs = new RasterCodecs(); 
   List<string> labels = fileNames.Select(fn => fn.Split('/', '\\').Last()).ToList(); 
   List<object> labels_AsCustomDataList = labels.Select(label => label as object).ToList(); 
   List<RasterImage> images = fileNames.Select(fn => codecs.Load(fn)).ToList(); 
 
   autoEngine.RunParallelPipesForList( 
       images, 
       ResultCallbackImage, 
       labels_AsCustomDataList, 
       repositoryNames, 
       8 
   ); 
 
   codecs.Dispose(); 
} 

Requirements

Target Platforms

See Also

AutoFormsEngine Class

AutoFormsEngine Members

Leadtools.Forms.Auto Namespace

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Auto Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.